// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

/**
 * Enum for lane restriction types.
 */
enum class FWorldLaneRestrictionType
{
	Simulator,
	AutonomousTraffic,
	Pedestrian,
	None
};

inline FWorldLaneRestrictionType FWorldLaneRestrictionTypeFromJson(const json& j)
{
	if (j == "simulator")			return FWorldLaneRestrictionType::Simulator;
	if (j == "autonomousTraffic")	return FWorldLaneRestrictionType::AutonomousTraffic;
	if (j == "pedestrian")			return FWorldLaneRestrictionType::Pedestrian;
	if (j == "none")				return FWorldLaneRestrictionType::None;
	return FWorldLaneRestrictionType::None;
}

inline json FWorldLaneRestrictionTypeToJson(FWorldLaneRestrictionType p)
{
	if (p == FWorldLaneRestrictionType::Simulator)			return "simulator";
	if (p == FWorldLaneRestrictionType::AutonomousTraffic)	return "autonomousTraffic";
	if (p == FWorldLaneRestrictionType::Pedestrian)			return "pedestrian";
	if (p == FWorldLaneRestrictionType::None)				return "none";
	return "none";
}

inline void from_json(const json& j, FWorldLaneRestrictionType& p)
{
	p = FWorldLaneRestrictionTypeFromJson(j);
}

inline void to_json(json& j, const FWorldLaneRestrictionType& p)
{
	j = FWorldLaneRestrictionTypeToJson(p);
}
